<template>
    <div>
        <h1 v-text="msg" ref="title"></h1>
        <button @click="showDOM" ref="btn">点我输出DOM元素</button>
        <School ref="sch"/>
    </div>
</template>

<script>
import School from './components/School'
export default {
    name: 'App',
    components: { School },
    data(){
        return {
            msg:'欢迎学习Vue'
        }
    },
    methods:{
        showDOM(){
            //获取DOM元素
            console.log(this.$refs);
            //真实DOM元素
            console.log(this.$refs.title);
            //真实DOM元素
            console.log(this.$refs.btn);
            //School组件的实例对象（vc）
            console.log(this.$refs.sch);
        }
    }
}
</script>